﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace ZYOPPC.控件
{
    public partial class 摇卦控件 : UserControl
    {
        private RadioButton[] rbs;

        private int iCheckedValue;
        public int Value
        {
            get { return iCheckedValue; }
        }

        public 摇卦控件()
        {
            InitializeComponent();
            rbs = new RadioButton[4] { r0, r1, r2, r3 };
        }

        private void CheckedChanged(object sender, EventArgs e)
        {
            //(0-老阳;1-阴;2-阳;3-老阴),如:012322 (0为初爻)
            for (int i = 0; i < rbs.Length; i++)
            {
                if (rbs[i].Checked)
                {
                    iCheckedValue = i;
                    break;
                }
            }
        }
    }
}
